
"""
:para: in_file , json file for input
:para: out_file,  ymal file will be converted to
:return:  True with no error or False with
"""
import json
import yaml
import sys
def convert(in_file,out_file):
    try:
        with open(in_file, 'r') as json_in:
            json_payload = json.load(json_in)

        with open(out_file, "w") as yaml_out:
            yaml.dump(json_payload, yaml_out,allow_unicode=True,sort_keys=False)
    except:
        return False
    return True


if __name__ == "__main__":
    in_file = sys.argv[1]
    out_file = sys.argv[2]
    if convert(in_file,out_file):
        print(' perfect')
    else:
        print('error')
